﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model
{
    /// <summary>
    /// 房屋信息
    /// </summary>
    public class House
    {
        public House() { }
        public House(   DateTime publishTime, DateTime exprDate, DateTime itkTime, 
                        int id = 0, int hHolderId = 0, int hTypeId = 0, int leaseModeId = 0,
                        int sCodeId=0, string address="", string adminReview="",
                        int duration = 0, int rentedTimes=0, string standard="", 
                        int isCheck=0, int isRecommended=0, int orderedTimes=0, int price=0,
                        string largeImageURI="", string ThumbnailURI="", int roomNumber=0) 
        {
            this.Id = id;
            this.HouseHolderId = hHolderId;
            this.HouseTypeId = hTypeId;
            this.LeaseModeId = leaseModeId;
            this.StatusCodeId = sCodeId;
            this.Address = address;
            this.AdminReview = adminReview;
            this.Duration = duration;
            this.ExpirationDate = exprDate;
            this.IntakeTime = itkTime;
            this.IsChecked = IsChecked;
            this.IsRecommended = IsRecommended;
            this.OrderedTimes = orderedTimes;
            this.Price = price;
            this.PublishTime = publishTime;
            this.RentedTimes = rentedTimes;
            this.Standard = standard;
            this.LargeImageUri = largeImageURI;
            this.ThumbnailUri = ThumbnailUri;
            this.RoomNumber = roomNumber;
        }
        public override bool Equals(object obj)
        {
            House o = (House)obj;
            if (this.PublishTime != o.PublishTime )
                return false;
            if(this.IntakeTime != o.IntakeTime )
                return false;
            if( this.IsChecked != o.IsChecked )
                return false;
            if( this.IsRecommended != o.IsRecommended )
                return false;
            if( this.LargeImageUri != o.LargeImageUri )
                return false;
            if( this.LeaseModeId != o.LeaseModeId )
                return false;
            if( this.RoomNumber != o.RoomNumber )
                return false;
            if( this.OrderedTimes != o.OrderedTimes )
                return false;
            if( this.Price != o.Price )
                return false;
            if( this.RentedTimes != o.RentedTimes )
                return false;
            if( this.Standard != o.Standard )
                return false;
            if( this.StatusCodeId != o.StatusCodeId )
                return false;
            if( this.ThumbnailUri != o.ThumbnailUri )
                return false;
            if( this.Address != o.Address )
                return false;
            if( this.AdminReview != o.AdminReview )
                return false;
            if( this.Duration != o.Duration )
                return false;
            if( this.ExpirationDate != o.ExpirationDate )
                return false;
            if( this.HouseHolderId != o.HouseHolderId )
                return false;
            if (this.HouseTypeId != o.HouseTypeId) 
                return false;
            return true;
        }
        #region Basic Getters and Setters
        private int _id;                        // PK

        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }


        private int _houseHolderId;             // FK   房主Id

        public int HouseHolderId
        {
            get { return _houseHolderId; }
            set { _houseHolderId = value; }
        }


        private int _statusCodeId;              // FK   状态码

        public int StatusCodeId
        {
            get { return _statusCodeId; }
            set { _statusCodeId = value; }
        }


        private int _houseTypeId;               // FK   房屋类型Id

        public int HouseTypeId
        {
            get { return _houseTypeId; }
            set { _houseTypeId = value; }
        }


        private int _leaseModeId;               // FK   出租方式Id

        public int LeaseModeId
        {
            get { return _leaseModeId; }
            set { _leaseModeId = value; }
        }

        private int _areaId;                    // FK   地区Id

        public int AreaId
        {
            get { return _areaId; }
            set { _areaId = value; }
        }

        private float _price;                   // 价格

        public float Price
        {
            get { return _price; }
            set { _price = value; }
        }


        private string _standard;               // 规格  例:两室一厅

        public string Standard
        {
            get { return _standard; }
            set { _standard = value; }
        }

        private int _roomNumber;                // 房间数量

        public int RoomNumber
        {
            get { return _roomNumber; }
            set { _roomNumber = value; }
        }


        private DateTime _expirationDate;       // 截止时间

        public DateTime ExpirationDate
        {
            get { return _expirationDate; }
            set { _expirationDate = value; }
        }

                                                // TODO  日租房单位应该是天
        private int _duration;                  // 出租时间    单位:月

        public int Duration
        {
            get { return _duration; }
            set { _duration = value; }
        }


        private DateTime _publishTime;          // 发布时间

        public DateTime PublishTime
        {
            get { return _publishTime; }
            set { _publishTime = value; }
        }


        private DateTime _intakeTime;           // 入住时间

        public DateTime IntakeTime
        {
            get { return _intakeTime; }
            set { _intakeTime = value; }
        }


        private string _address;                // 地址

        public string Address
        {
            get { return _address; }
            set { _address = value; }
        }


        private int _rentedTimes;               // 租出次数

        public int RentedTimes
        {
            get { return _rentedTimes; }
            set { _rentedTimes = value; }
        }


        private int _orderedTimes;              // 预约次数

        public int OrderedTimes
        {
            get { return _orderedTimes; }
            set { _orderedTimes = value; }
        }


        private string _adminReview;            // 管理员点评

        public string AdminReview
        {
            get { return _adminReview; }
            set { _adminReview = value; }
        }


        private int _isChecked;                 // 是否被管理员审核

        public int IsChecked
        {
            get { return _isChecked; }
            set { _isChecked = value; }
        }


        private int _isRecommended;             // 是否被管理员推荐

        public int IsRecommended
        {
            get { return _isRecommended; }
            set { _isRecommended = value; }
        }

        private string _largeImageUri;        // 大图URI

        public string LargeImageUri
        {
            get { return _largeImageUri; }
            set { _largeImageUri = value; }
        }


        private string _thumbnailUri;           // 缩略图URI

        public string ThumbnailUri
        {
            get { return _thumbnailUri; }
            set { _thumbnailUri = value; }
        }

        private int _rating;                   // 评分

        public int Rating
        {
            get { return _rating; }
            set { _rating = value; }
        }
        #endregion
    }
}
